<?php
namespace app\common\validate;
use think\Validate;
class Area extends Validate {
    protected $rule = [
        ['id','number'],
        ['name','require|max:15','地区名必须填写|地区名不能超过15个字符'],
        ['city_id','number'],
        ['parent_id','number'],
        ['listorder','number'],
        ['status','number|in:-1,0,1','状态必须是数字|状态范围不合法'],
    ];

    // 场景设置
    protected  $scene = [
        'add' => ['name', 'id', 'city_id','parent_id'],
        'listorder'=>['id','listorder'],
        'status' =>['id','status'],
    ];
}